package com.liuchuanzheng.lcz_wanandroid.ui.viewmodel

import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope
import com.liuchuanzheng.lcz_wanandroid.net.ArticleListBean
import com.liuchuanzheng.lcz_wanandroid.ui.repository.QuestionRepository
import kotlinx.coroutines.launch

/**
 * @author 刘传政
 * @date 2021/6/28 9:48
 * QQ:1052374416
 * 电话:18501231486
 * 作用:
 * 注意事项:
 */
class QuestionViewModel: ViewModel(){
    private val repository = QuestionRepository()
    val questionData = MutableLiveData<ArticleListBean>()
    fun getQustionList(page:Int){
        viewModelScope.launch {
            var questions = repository.getQuestionList(page)
            questionData.value = questions.data
        }
    }
}